package com.example.bishe.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.bishe.entity.Message;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.bishe.web.c.vo.UserApprovalVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author LDH
 * @since 2023/04/02
 */
@Mapper
public interface MessageMapper extends BaseMapper<Message> {

    @Select("SELECT * FROM message WHERE uid=#{userId} OR type=1 ORDER BY create_time DESC")
    IPage<Message> getMessage(
            IPage<Message> page,
            @Param("userId") Long userId
    );

}
